home *** CD-ROM | disk | FTP | other *** search
/ Champak 114 / Vol 114.iso / games / y2k_tetr.swf / scripts / DefineSprite_42 / frame_4 / DoAction.as
Encoding:
Text File  |  2010-08-12  |  2.1 KB  |  84 lines

  1. result2 = "nook";
  2. set("..:flp","0");
  3. tek_x = getProperty("../figure", _X);
  4. tek_y = getProperty("../figure", _Y);
  5. tek_xm = eval("..:max_x") * "10";
  6. tek_ym = eval("..:max_y") * "10";
  7. fl1 = "0";
  8. fl2 = "0";
  9. fl3 = "0";
  10. n = "1";
  11. while("4" >= n)
  12. {
  13.    if(n == "1")
  14.    {
  15.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k1", _X) - "5") / "10" + "1";
  16.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k1", _Y) - "5") / "10" + "1";
  17.    }
  18.    if(n == "2")
  19.    {
  20.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k2", _X) - "5") / "10" + "1";
  21.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k2", _Y) - "5") / "10" + "1";
  22.    }
  23.    if(n == "3")
  24.    {
  25.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k3", _X) - "5") / "10" + "1";
  26.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k3", _Y) - "5") / "10" + "1";
  27.    }
  28.    if(n == "4")
  29.    {
  30.       tposx = (getProperty("../figure", _X) + getProperty("../figure/k4", _X) - "5") / "10" + "1";
  31.       tposy = (getProperty("../figure", _Y) + getProperty("../figure/k4", _Y) - "5") / "10" + "1";
  32.    }
  33.    if(int(tposy) - tposy == "0")
  34.    {
  35.       if(eval("..:dim" add tposx add "_" add tposy) eq "")
  36.       {
  37.          fl1 += "1";
  38.       }
  39.       if(tposy + "1" < eval("..:max_y") + "2")
  40.       {
  41.          fl2 += "1";
  42.       }
  43.       if("0" < tposx and tposx < eval("..:max_x") + "1")
  44.       {
  45.          fl3 += "1";
  46.       }
  47.    }
  48.    else
  49.    {
  50.       m = int(tposy) - tposy;
  51.       if("0" < m)
  52.       {
  53.          ty = tposy - m;
  54.       }
  55.       else
  56.       {
  57.          ty = tposy + m;
  58.       }
  59.       ty1 = ty + "1";
  60.       if(eval("..:dim" add tposx add "_" add ty) eq "" and eval("..:dim" add tposx add "_" add ty1) eq "")
  61.       {
  62.          fl1 += "1";
  63.       }
  64.       if(ty1 < eval("..:max_y") + "1")
  65.       {
  66.          fl2 += "1";
  67.       }
  68.       if("0" < tposx and tposx < eval("..:max_x") + "1")
  69.       {
  70.          fl3 += "1";
  71.       }
  72.    }
  73.    n += "1";
  74. }
  75. if(fl1 == "4" and fl2 == "4" and fl3 == "4")
  76. {
  77.    result2 = "ok";
  78. }
  79. if(fl2 != "4")
  80. {
  81.    set("..:flp","1");
  82. }
  83. stop();
  84.